home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac Power 1997 December
/
MACPOWER-1997-12.ISO.7z
/
MACPOWER-1997-12.ISO
/
AMUG
/
PROGRAMMING
/
Raven 1.2 Examples.sit
/
Raven 1.2 Examples
/
Quill
/
Source
/
ClickNotifier.cpp
< prev
next >
Wrap
Text File
|
1997-08-07
|
2KB
|
62 lines
/*
* File: ClickNotifier.cpp
* Function: A behavior that sends a command to an MCommander when its owner
* is clicked.
* Written by: Jesse Jones
*
* Copyright ゥ 1997 Jesse Jones.
* For conditions of distribution and use, see copyright notice in ZTypes.h
*
* Change History (most recent first):
*
* <1> 5/04/97 JDJ Created (from CClickBehavior in TextTraitsDialog.cpp)
*/
#include "ClickNotifier.h"
#include <ZCommander.h>
// ===================================================================================
// class CClickNotifier
// ===================================================================================
//---------------------------------------------------------------
//
// CClickNotifier::~CClickNotifier
//
//---------------------------------------------------------------
CClickNotifier::~CClickNotifier()
{
}
//---------------------------------------------------------------
//
// CClickNotifier::CClickNotifier
//
//---------------------------------------------------------------
CClickNotifier::CClickNotifier(MCommander* notifyee, const string& command)
{
ASSERT(notifyee != nil);
ASSERT(command != "");
mNotify = notifyee;
mCommand = command;
}
//---------------------------------------------------------------
//
// CClickNotifier::OnExecute
//
//---------------------------------------------------------------
bool CClickNotifier::OnExecute(TMouseEvent& event)
{
if (event.WasMouseDown())
mNotify->HandleMenuCommand(mCommand);
return kNotHandled; // let the owner handle the click
}